import { createApp } from 'vue';
import App from './App.vue';
import ElementPlus from 'element-plus';
import 'element-plus/dist/index.css';
import router from "@/router/index.js";
import axios from "axios";
import infiniteScroll from 'vue-infinite-scroll';

axios.defaults.baseURL = "http://localhost:8080";
axios.interceptors.request.use((config) => {
    let token = localStorage.getItem("token");
    if (token)
        config.headers['Authorization'] = token;
    return config;
});

const app = createApp(App);
app.use(ElementPlus)
    .use(router)
    .use(infiniteScroll)
    .mount('#app');